#------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0.  See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#

set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 1000)
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1000)

list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
  "H5PL\\.c.*dlopen.*glibc"
  "gtest\\.cc.*getaddrinfo.*glibc"
  ".*/thirdparty/.*"
  "warning: Using '.*' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking"
  "PGC.*compilation completed with warnings"
  "Warning: stand-alone `data16' prefix"
  "Warning: Type mismatch between actual argument.*"
  "Warning: Rank mismatch between actual argument.*"
  "zfp/types.h.*typedef"
  "was built for newer macOS version"
  "warning generated"
  "warnings generated"
  "warning: template parameter ... is not used in declaring the parameter types of function template"
  "warning: command-line option '.*' is valid for Fortran but not for C"
  "Warning #20208-D: '.*' is treated as '.*' in device code"
  "Warning: '.*' is treated as '.*' in device code"
  ".*was specified as both a system and non-system include directory.*"
  "Wunused-command-line-argument"
  "ld: warning: -undefined dynamic_lookup may not work with chained fixups"
  "ld: warning: ignoring duplicate libraries:"
)
list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
  ".*/thirdparty/.*"
  ".*/testing/.*"
  ".*/examples/.*"
)

if (@CMAKE_SYSTEM_PROCESSOR@ STREQUAL "ppc64le")

# Exclude flaky tests for now
list(APPEND CTEST_CUSTOM_TESTS_IGNORE
  "Interface.ADIOSInterface.ADIOSNoMpi.Serial"
  "Interface.ADIOS2_CXX11_API_MultiBlock/*.Put.Serial"
  "Interface.ADIOS2_CXX11_API_IO.EngineDefault.Serial"
  "Interface.ADIOS2_CXX11_API_IO.Engine.Serial"
)

endif()
